import request from '@/config/axios'

// 随机头像 VO
export interface AvatarInfoVO {
  id: number // 主键
  avatar: string // 头像图片
}

// 随机头像 API
export const AvatarInfoApi = {
  // 查询随机头像分页
  getAvatarInfoPage: async (params: any) => {
    return await request.get({ url: `/business/avatar-info/page`, params })
  },

  // 查询随机头像详情
  getAvatarInfo: async (id: number) => {
    return await request.get({ url: `/business/avatar-info/get?id=` + id })
  },

  // 新增随机头像
  createAvatarInfo: async (data: AvatarInfoVO) => {
    return await request.post({ url: `/business/avatar-info/create`, data })
  },

  // 修改随机头像
  updateAvatarInfo: async (data: AvatarInfoVO) => {
    return await request.put({ url: `/business/avatar-info/update`, data })
  },

  // 删除随机头像
  deleteAvatarInfo: async (id: number) => {
    return await request.delete({ url: `/business/avatar-info/delete?id=` + id })
  },

  // 导出随机头像 Excel
  exportAvatarInfo: async (params) => {
    return await request.download({ url: `/business/avatar-info/export-excel`, params })
  },
}